<?php
namespace Site\Model;
use Think\Model\RelationModel;
class UserModel extends RelationModel {
	protected $_link = array(
        'Role'=>array(
            'mapping_type'    =>self::BELONGS_TO,
            'class_name'    =>'user_role',
            'foreign_key'=>'roleid',
            'mapping_name' =>'role',
        ),
    );
}

?>